#from yacf.Frontend.C import c_parser, c_ast
import sys

tab_size = 2;

class OffsetNodeVisitor(object):
    def __init__(self,):
        self._enclosing = False

    def visit(self, node, offset = 0):
        """ Visit a node. 
        """
        method = 'visit_' + node.__class__.__name__
        visitor = getattr(self, method, self.generic_visit)
        return visitor(node, offset)

    def generic_visit(self, node, offset = 0):
        """ Called if no explicit visitor function exists for a 
            node. Implements preorder visiting of the node.
         """
        for c in node.children():
            self.visit(c)

